clear
clc
close all


boot.soleLength = 30e-2;
binding.model = 'bulldog';
binding.nTubes = [2;1;1;1;1];

binding.springs = [1,1;
    1,1;
    1,1;
    1,1;
    1,1]*.0254*4;  %vector of spring lengths in series
% data.binding.springs = [1,1]*.0254*4;
binding.springType = {'blue','blue';
    'blue','red';
    'red','red';
    'gold','red';
    'gold','gold'}; %vector of spring types in series
% data.binding.springType = {'blue','blue'};

% data.binding.springs=2*4*.0254;
% data.binding.springType = {'red'};

binding.pivotPosition = 7;
binding.preload = 0.3*.0254;

opts.a = 1;

plotInd = 0;


nCases = length(binding.springs(:,1));

for i = 1:nCases
    data(i).boot.soleLength = boot.soleLength;
    data(i).binding.model = binding.model;
    data(i).binding.nTubes = binding.nTubes(i);
    data(i).binding.springs = binding.springs(i,:);
    data(i).binding.springType = binding.springType(i,:);
    data(i).binding.pivotPosition = binding.pivotPosition;
    data(i).binding.preload = binding.preload;
    
    [data(i).rotation, data(i).Fh_torque] = adaptiveLoadPath(data(i),opts,plotInd);
end


figure;
hold all
for i = 1:nCases
    ph(i) = plot(data(i).rotation,data(i).Fh_torque);
    lstring = [num2str(binding.nTubes(i)) ' tubes, ' ...
        num2str(binding.springs(i,1)/.0254) ' inch of ' binding.springType{i,1} ', ' ...
        num2str(binding.springs(i,2)/.0254) ' inch of ' binding.springType{i,2}];
    lvals{i} = lstring;
end

xlabel('Heel rotation angle (deg)')
ylabel('Heel lift torque (N*m)')
legend(ph,lvals)